<template>
    <div class="f-tag-list"  :style="{left:$store.state.asideWidth}">
                  
      <el-tabs v-model="activeTab" type="card" class="flex-1" @tab-remove="removeTab" style="min-width:100px;"
        @tab-change="changeTab">
            <el-tab-pane :closable="item.path != '/'" v-for="item in tabList" :key="item.path" :label="item.title" :name="item.path"></el-tab-pane>
        </el-tabs>
 <span class="tag-btn">
            <el-dropdown  @command="handleClose">
                <span class="el-dropdown-link">
                    <el-icon>
                        <arrow-down />
                    </el-icon>
                </span>
                <template #dropdown>
                    <el-dropdown-menu>
                        <el-dropdown-item command="clearOther">关闭其它</el-dropdown-item>
                        <el-dropdown-item command="clearAll">关闭所有</el-dropdown-item>
                        
                    </el-dropdown-menu>
                </template>
            </el-dropdown>
        </span>
    </div> 
    <div style="height: 44px;"></div>
</template>
<script setup>
import { useTabList} from "~/composables/useTabList.js"
const{
  activeTab,
        tabList,
        changeTab,
        removeTab,
        handleClose
} = useTabList()
</script>
<style>
    .f-tag-list{
        @apply fixed bg-gray-100 flex items-center;
        top: 64px;
        right: 0px;
       height: 44px;
       z-index: 1000;
       
    }
    .tag-btn{
        @apply bg-white rounded ml-auto flex items-center justify-center px-2;
        height: 32px;
    }
   .el-tabs__header {
    padding: 0;
    position: relative;
    margin: 0 0 ;
    border: 0 !important;
}
.el-tabs__nav{
    border: 0 !important;
}
.el-tabs__item{
    border: 0 !important;
    height: 36px;
    line-height:36px;
    @apply bg-white mx-1 rounded;
}


:deep(.el-tabs__nav-next),:deep(.el-tabs__nav-prev){
    line-height: 36px;
    height: 36px;
} 
/* 未实现可点 不可点 */
:deep(.is-disabled){
    cursor: not-allowed;
    @apply text-gray-300;
}

</style>